<template>
	<div class="easyd-weixin-Box">
		<div class="addServiceheader">
			<div class="addServiceBtn" @click="goAddPrivateMessage">
				<i class="fa fa-credit-card fa-lg"></i>
				新增模板
			</div>
		</div>
		<div class="serviceManagerBox">
			<mt-loadmore
				:top-method="loadTop"
				:bottom-method="loadBottom"
				:bottom-all-loaded="allLoaded"
				ref="loadmore"
			>
				<div class="serviceManagerItem" v-for="i in 5">
					<div>
						<div class="title">模板名称</div>
						<div class="serviceManagerItemImage">
              <img src="~BUSSINESS_IMAGE/images/sixinmoban.jpg">
						</div>
					</div>
          <div class="serviceManagerItemDesc">
            	收到了付款实际的收到了付款实际的收到了付款实际的收到了付款实际的收到了付款实际的收到了付款实际的
          </div>
					<div class="serviceManagerMenu">
						<div class="serviceManagerMenuItem">
							<i class="fa fa-paper-plane fa-lg"></i>
							浏览
						</div>
						<div class="serviceManagerMenuItem">
							<i class="fa fa-edit fa-lg"></i>
							编辑
						</div>
						<div class="serviceManagerMenuItem">
							<i class="fa fa-trash fa-lg"></i>
							删除
						</div>
            <div class="serviceManagerMenuItem">
							<i class="fa fa-trash fa-lg"></i>
							删除
						</div>
					</div>
				</div>
			</mt-loadmore>
		</div>
	</div>
</template>

<script>
export default {
	data() {
		return {
			allLoaded: false,
			imageDemoUrl: 'http://testfileupload.oss-cn-beijing.aliyuncs.com/hengtu2.jpeg'
		};
	},
	methods: {
		loadTop() {
			setTimeout(() => {
				this.$refs.loadmore.onTopLoaded();
			}, 2000);
		},
		loadBottom() {
			setTimeout(() => {
				this.allLoaded = true;
				this.$refs.loadmore.onBottomLoaded();
			}, 5000);
    },
    goAddPrivateMessage(){
      this.$router.push({
        path : '/addPrivateMessage'
      })
    }
	}
};
</script>

<style lang="stylus" scoped>
@import '~PUBLIC_CSS'
.addServiceheader {
  width: 100%;
  height: 50px;
  padding: 0px 15px 0px 15px;
  margin-top: 15px;
  box-sizing: border-box;

  .addServiceBtn {
    width: 100%;
    height: 50px;
    text-align: center;
    line-height: 50px;
    $itemStyle()

    i {
      color: #999;
      font-size: 14px;
      position: relative;
      top: -2px;
      right: 10px;
    }
  }
}

.serviceManagerBox {
  position: absolute;
  top: 80px;
  bottom: 0px;
  left: 0px;
  box-sizing: border-box;
  padding-left: 15px;
  padding-right: 15px;
  overflow auto
  -webkit-overflow-scrolling : touch;
  right: 0px;

  .serviceManagerItem {
    width: 100%;
    height 360px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    padding-top: 0.266667rem;
    padding-left: 0.266667rem;
    padding-right: 0.266667rem;
    margin-bottom: 0.4rem;
    $itemStyle()

    .serviceManagerItemDesc {
      margin-top 10px
      float left  
    }

    .serviceManagerItemImage {
       width 100%
       height 200px
       float left

       img {
         $imgStyle()
         margin-bottom 10px
       }
    }

	.title{
		padding-bottom:10px;
    font-weight 500
	}

    .serviceManagerMenu {
      width: 100%;
      height: 50px;
      display: flex;
      justify-content: space-between;
      margin-top: -4px;
      border-bottom-left-radius: 5px;
      border-bottom-right-radius: 5px;

      .serviceManagerMenuItem {
        flex: 1;
        height: 50px;
        text-align: center;
        line-height: 48px;

        i {
          color: #999;
          font-size: 16px;
          position: relative;
          top: -1px;
          right: 5px;
        }
      }
    }

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-top-left-radius: 5px;
      border-top-right-radius: 5px;
    }
  }
}
</style>
